home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
X User Tools
/
X User Tools (O'Reilly and Associates)(1994).ISO
/
sun4c
/
archive
/
tcltk.z
/
tcltk
/
man
/
catn
/
info.n
< prev
next >
Wrap
Text File
|
1994-09-20
|
8KB
|
199 lines
info(n) Tcl Built-In Commands 7.0
_________________________________________________________________
NAME
info - Return information about the state of the Tcl inter-
preter
SYNOPSIS
info _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
_________________________________________________________________
DESCRIPTION
This command provides information about various internals of
the Tcl interpreter. The legal _o_p_t_i_o_n's (which may be
abbreviated) are:
info args _p_r_o_c_n_a_m_e
Returns a list containing the names of the arguments to
procedure _p_r_o_c_n_a_m_e, in order. _P_r_o_c_n_a_m_e must be the
name of a Tcl command procedure.
info body _p_r_o_c_n_a_m_e
Returns the body of procedure _p_r_o_c_n_a_m_e. _P_r_o_c_n_a_m_e must
be the name of a Tcl command procedure.
info cmdcount
Returns a count of the total number of commands that
have been invoked in this interpreter.
info commands ?_p_a_t_t_e_r_n?
If _p_a_t_t_e_r_n isn't specified, returns a list of names of
all the Tcl commands, including both the built-in com-
mands written in C and the command procedures defined
using the proc command. If _p_a_t_t_e_r_n is specified, only
those names matching _p_a_t_t_e_r_n are returned. Matching is
determined using the same rules as for string match.
info complete _c_o_m_m_a_n_d
Returns 1 if _c_o_m_m_a_n_d is a complete Tcl command in the
sense of having no unclosed quotes, braces, brackets or
array element names, If the command doesn't appear to
be complete then 0 is returned. This command is typi-
cally used in line-oriented input environments to allow
users to type in commands that span multiple lines; if
the command isn't complete, the script can delay
evaluating it until additional lines have been typed to
complete the command.
info default _p_r_o_c_n_a_m_e _a_r_g _v_a_r_n_a_m_e
_P_r_o_c_n_a_m_e must be the name of a Tcl command procedure
and _a_r_g must be the name of an argument to that pro-
cedure. If _a_r_g doesn't have a default value then the
Tcl 1
info(n) Tcl Built-In Commands 7.0
command returns 0. Otherwise it returns 1 and places
the default value of _a_r_g into variable _v_a_r_n_a_m_e.
info exists _v_a_r_N_a_m_e
Returns 1 if the variable named _v_a_r_N_a_m_e exists in the
current context (either as a global or local variable),
returns 0 otherwise.
info globals ?_p_a_t_t_e_r_n?
If _p_a_t_t_e_r_n isn't specified, returns a list of all the
names of currently-defined global variables. If _p_a_t_-
_t_e_r_n is specified, only those names matching _p_a_t_t_e_r_n
are returned. Matching is determined using the same
rules as for string match.
info level ?_n_u_m_b_e_r?
If _n_u_m_b_e_r is not specified, this command returns a
number giving the stack level of the invoking pro-
cedure, or 0 if the command is invoked at top-level.
If _n_u_m_b_e_r is specified, then the result is a list con-
sisting of the name and arguments for the procedure
call at level _n_u_m_b_e_r on the stack. If _n_u_m_b_e_r is posi-
tive then it selects a particular stack level (1 refers
to the top-most active procedure, 2 to the procedure it
called, and so on); otherwise it gives a level relative
to the current level (0 refers to the current pro-
cedure, -1 to its caller, and so on). See the uplevel
command for more information on what stack levels mean.
info library
Returns the name of the library directory in which
standard Tcl scripts are stored. The default value for
the library is compiled into Tcl, but it may be over-
ridden by setting the TCL_LIBRARY environment variable.
If there is no TCL_LIBRARY variable and no compiled-in
value then and error is generated. See the library
manual entry for details of the facilities provided by
the Tcl script library. Normally each application will
have its own application-specific script library in
addition to the Tcl script library; I suggest that
each application set a global variable with a name like
$_a_p_p_library (where _a_p_p is the application's name) to
hold the location of that application's library direc-
tory.
info locals ?_p_a_t_t_e_r_n?
If _p_a_t_t_e_r_n isn't specified, returns a list of all the
names of currently-defined local variables, including
arguments to the current procedure, if any. Variables
defined with the global and upvar commands will not be
returned. If _p_a_t_t_e_r_n is specified, only those names
matching _p_a_t_t_e_r_n are returned. Matching is determined
Tcl 2
info(n) Tcl Built-In Commands 7.0
using the same rules as for string match.
info patchlevel
Returns a decimal integer giving the current patch |
level for Tcl. The patch level is incremented for each |
new release or patch, and it uniquely identifies an |
official version of Tcl.
info procs ?_p_a_t_t_e_r_n?
If _p_a_t_t_e_r_n isn't specified, returns a list of all the
names of Tcl command procedures. If _p_a_t_t_e_r_n is speci-
fied, only those names matching _p_a_t_t_e_r_n are returned.
Matching is determined using the same rules as for
string match.
info script
If a Tcl script file is currently being evaluated (i.e.
there is a call to Tcl_EvalFile active or there is an
active invocation of the source command), then this
command returns the name of the innermost file being
processed. Otherwise the command returns an empty
string.
info tclversion
Returns the version number for this version of Tcl in
the form _x._y, where changes to _x represent major
changes with probable incompatibilities and changes to
_y represent small enhancements and bug fixes that
retain backward compatibility.
info vars ?_p_a_t_t_e_r_n?
If _p_a_t_t_e_r_n isn't specified, returns a list of all the
names of currently-visible variables, including both
locals and currently-visible globals. If _p_a_t_t_e_r_n is
specified, only those names matching _p_a_t_t_e_r_n are
returned. Matching is determined using the same rules
as for string match.
KEYWORDS
command, information, interpreter, level, procedure, vari-
able
Tcl 3